-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing InvalidArgumentException with 'Cannot redirect to an empty URL' #198
Conversation
….' when Referer header exists but empty
@lsmith77, could you give me some feedback, please? |
makes sense .. could you also add a test case? |
I added unit-test for all cases came into my mind + also I covered the case when NotFoundHttpException is thrown. But it's hard to cover the case with $cookieOptions, because of the time() function. If you want, I can extract this time() function to separate TimeProvider and mock it. Also I added SymfonyResponseComparator to prevent build from failure. It happened during comparison two Symfony-responses: their Date-headers are are different from each other. That's because new DateTime() during response creation. When the time between creation of two responses differs more than 1 sec, build fails. SymfonyResponseComparator removes Date-header from the comparison of two responses. |
nice! SymfonyResponse might even be something for Symfony core ..? for the call to |
perfect! |
@lsmith77, thank you so much for your feedback! May I ask you to create a new Release (1.6.2)? |
I will make a release as soon as #200 is merged. However the next release will be 1.7.0 |
@lsmith77, great! I'll be waiting for it =) |
sorry for the delay https://github.com/liip/LiipThemeBundle/releases/tag/1.7.0 |
@lsmith77, thank you so much! |
This exception occurs when 'Referer' header exists but empty.
In this case empty string goes to the first arg of \Symfony\Component\HttpFoundation\RedirectResponse constructor.
And then \InvalidArgumentException is thrown inside \Symfony\Component\HttpFoundation\RedirectResponse::setTargetUrl method.